package com.atguigu.bean;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * @author gcq
 * @Create 2020-09-22
 */
@Component
public class Dog {
    public Dog() {
        System.out.println("dog constructor....");
    }
    // 对象创建并赋值后
    @PostConstruct
    public void init() {
        System.out.println("Dog.....Constructor....");
    }

    @PreDestroy
    public void detory() {
        System.out.println("Dog.......Destory.....");
    }
}